package com.gmail.dengtao.joe.game.model;

import com.gmail.dengtao.joe.group.member.EqualsBuilder;
import com.gmail.dengtao.joe.group.member.HashCodeBuilder;

public class Player {

	private String name;
	private int shape;
	private String color;
	private int x;
	private int y;
	
	public String getColor() {
		return color;
	}
	public void setColor(String color) {
		this.color = color;
	}
	public int getX() {
		return x;
	}
	public void setX(int x) {
		this.x = x;
	}
	public int getY() {
		return y;
	}
	public void setY(int y) {
		this.y = y;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getShape() {
		return shape;
	}
	public void setShape(int shape) {
		this.shape = shape;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == null)
            return false;
        if (obj == this)
            return true;
        if (obj.getClass() != getClass())
            return false;
        Player player = (Player) obj;
		return new EqualsBuilder().append(name, player.getName()).isEquals();
	}

	@Override
	public int hashCode() {
		return new HashCodeBuilder().append(name).build();
	}

	@Override
	public String toString() {
		return "Player [name=" + name + ", shape=" + shape + ", color=" + color
				+ ", x=" + x + ", y=" + y + "]";
	}
}